﻿var express = require('express');
var ApiProxy = require('../app.js');
ApiProxy.init("./demo/interfaces/interfaces.json");

var app = express();

app.use("/api", ApiProxy.Proxy);

app.get('/', function (req, res) {
    res.send('Hello World!');
});

app.get('/test', function (req, res) {
    ApiProxy.Api("apiTest", null).done(function (data) {
        res.end(JSON.stringify(data.data));
    });
});

app.get('/apitest', function (req, res){
    res.end("Test Api Proxy");
})

var server = app.listen(3000, function () {
    var host = server.address().address;
    var port = server.address().port;
    console.log('Example app listening at http://%s:%s', host, port);
});